<?php
header('Content-Type: text/html; charset=utf-8');
//require('include/config/config.php');
//
//$smarty=new smarty_class();
error_reporting(E_ALL);
ini_set('display_errors', 1);

define('HOME_DEBUG', FALSE);

define('HOME_PAGE', TRUE);

define('HOME_ROOT', realpath(dirname(__FILE__)));

define('HOME_HEADER', TRUE);

set_include_path(get_include_path() . PATH_SEPARATOR . realpath("./"));

if (!isset($page))
    $page = "";
// INITIATE SMARTY

include "include/class_smarty.php";

$smarty = & HOMESmarty::getInstance();
 
include "include/database_config.php";

include "include/class_database.php";

include "include/class_url.php";

include "include/functions_general.php";

include "include/class_user.php";
include "include/class_session.php";
include "include/class_validate.php";

include "include/class_transaction.php";
include "include/class_mail.php";
include "include/class_import.php";

date_default_timezone_set("Asia/Bangkok");

// INITIATE DATABASE CONNECTION
$url=new HOMEUrl();
$database = & HOMEDatabase::getInstance();
$url=new HOMEUrl();

$_POST = security($_POST);
$_GET = security($_GET);
$_COOKIE = security($_COOKIE);

// CREATE USER OBJECT AND ATTEMPT TO LOG USER IN
$user = new HOMEUser();
$user->user_checkCookies();
